package com.test.listview;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.test.listview.util.ActivityUtil;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * 此处应有描述
 *
 * @author wujy
 * @date 2016年01月26日 10:23
 */
public class MainActivity extends Activity implements View.OnClickListener{

    @InjectView(R.id.base_adapter_btn)
    Button mBaseBtn;
    @InjectView(R.id.base_adapter_more_btn)
    Button mBaseMoreBtn;

    @InjectView(R.id.cursor_btn)
    Button mCursorBtn;

    @InjectView(R.id.contact_list_btn)
    Button mContactListBtn;
    @InjectView(R.id.grid_view_btn)
    Button mGridViewBtn;
    @InjectView(R.id.grid_view_more_btn)
    Button mGridViewMoreBtn;
    /**作业示例*/
    @InjectView(R.id.task_demo_btn)
    Button mTaskDemoBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ButterKnife.inject(this);

        findAndSettings();
    }

    /**
     * 查找和设置
     */
    private void findAndSettings(){
        mBaseBtn.setOnClickListener(this);
        mBaseMoreBtn.setOnClickListener(this);

        mCursorBtn.setOnClickListener(this);
        mContactListBtn.setOnClickListener(this);
        mGridViewBtn.setOnClickListener(this);
        mGridViewMoreBtn.setOnClickListener(this);
        mTaskDemoBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.base_adapter_btn:
                ActivityUtil.startBaseAdapter(this);
                break;
            case R.id.base_adapter_more_btn:
                ActivityUtil.startBaseAdapterMore(this);
                break;
            case R.id.cursor_btn:
                ActivityUtil.startCursor(this);
                break;
            case R.id.contact_list_btn:
                ActivityUtil.startContactList(this);
                break;
            case R.id.grid_view_btn:
                ActivityUtil.startGridView(this);
                break;
            case R.id.grid_view_more_btn:
                ActivityUtil.startGridViewMore(this);
                break;
            case R.id.task_demo_btn:
                ActivityUtil.startTaskDemo(this);
                break;
        }
    }
}
